import Vue from "vue"

import App from "./App.vue"

// 1. 引入vue-router
import VueRouter from "vue-router"
// 2. 需要安装一下VueRouter插件
Vue.use(VueRouter);

import Index from "./src/components/index.vue"
import Login from "./src/components/login.vue"

// 3. 制定路由规则
let router = new VueRouter({
    routes: [
        {
            path: "/index",
            component: Index
        },
        {
            path: "/login",
            component: Login
        }
    ]
})


const vm = new Vue({
    el: "#app",
    render: function(createElement){
        return createElement(App);
    },
    router
})